﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SearchInHospitalMoney.aspx.cs" Inherits="Page_Customer_SearchInHospitalMoney" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no" />
    <title>住院费用</title>
    <link href="../../Content/syzyy/css/reset.css" rel="stylesheet" />
    <link href="../../Content/syzyy/css/ylt_common.css" rel="stylesheet" />
    <link href="../../layui/css/layui.css" rel="stylesheet" />
    <%--layui--%>
    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="../../Scripts/jquery.form.js"></script>
    <script src="../../layui/layui.js"></script>
    <script src="../../Content/syzyy/js/additional-methods.js"></script>
    <style type="text/css">
        body {
            background-color: #fff;
        }

        .appoint_footer {
            padding: 6% 8%;
            width: 84%;
            min-height: 64px;
        }
    </style>
</head>
<body>
    <header class="appoint_header">
        <img class="appoint_icon" src="../../Content/syzyy/img/hos_fee.png" />
        <div class="tips_con">
            <h5 class="appointment_status">住院费用</h5>
            <p class="appointment_tips">
                当天的费用信息统计有延迟；在我的缴费中可以查看缴费记录；
					
            </p>
        </div>
    </header>
    <form id="AddForm" name="hospitalization_cost_form" enctype="multipart/form-data" method="post">
        <!--表单提交-->
        <ul class="xz_jzr">
            <li class="">
                <img class="xz_icon xz_blur" src="../../Content/syzyy/img/icon_xingming2@2x.png" />
                <img class="xz_icon xz_focus" style="display: none;" src="../../Content/syzyy/img/icon_xingming@2x.png" />
                <!--<span class="xz_tit">就诊人:</span>-->
                <input type="text" id="realName" name="realName" placeholder="请填写就诊人" class="xz_vl" value="<%=Model != null ? Model.PatientName : "" %>">
                <a href="#" class="xz_abs_icon">
                    <img src="../../Content/syzyy/img/u172.png" /></a>
            </li>

            <li class="">

                <img class="xz_icon xz_blur" src="../../Content/syzyy/img/icon_shenfenzheng2@2x.png" />
                <img class="xz_icon xz_focus" style="display: none;" src="../../Content/syzyy/img/icon_shenfenzheng@2x.png" />
                <!--<span class="xz_tit">身份证号:</span>-->

                <input type="text" id="idCard" name="idCard" placeholder="请填写身份证号" class="xz_vl" value="<%=Model != null ? Model.PatientIdCard : "" %>">

                <a class="xz_abs_icon">
                    <img src="../../Content/syzyy/img/icon_saoyisao1@2x.png" />
                </a>
            </li>

            <li class="">
                <img class="xz_icon xz_blur" src="../../Content/syzyy/img/icon_jiuzhenka2@2x.png" />
                <img class="xz_icon xz_focus" style="display: none;" src="../../Content/syzyy/img/icon_jiuzhenka@2x.png" />
                <!--<span class="xz_tit">住院号:</span>-->
                <input type="text" id="patientCard" name="patientCard" placeholder="请填写就诊卡号" class="xz_vl" value="<%=Model != null ? Model.PatientPatiID : "" %>">
                <a class="xz_abs_icon">
                    <img src="../../Content/syzyy/img/icon_saoyisao2@2x.png" />
                </a>
            </li>

        </ul>
        <div class="appoint_footer">
            <button id="add_jzr" class="u-btn u-btn-green u-btn-lg" lay-submit="" lay-filter="formDemo">查询住院费用</button>
        </div>
    </form>

    <div id="errormsgs" class="errormsgs"
        style="padding: 10px; color: red; font-weight: bold; display: none;">
        &nbsp;
    </div>

    <script>

        $('.xz_vl').each(function (i, e) {
            $(e).blur(function () {
                $(this).siblings('.xz_focus').hide();
                $(this).siblings('.xz_blur').show();
            });
            $(e).focus(function () {
                $(this).siblings('.xz_focus').show();
                $(this).siblings('.xz_blur').hide();
            });
        });

        function ShowRequest(data) {
            if (data.status == "1") {
                $("#add_jzr").text("查询住院费用");
                $("#add_jzr").attr('disabled', false);
                window.location.href = data.info;
            }
            else {
                layer.msg(data.info, {
                    time: 1000 //2秒关闭（如果不配置，默认是3秒）
                }, function () {
                    $("#add_jzr").text("查询住院费用");
                    $("#add_jzr").attr('disabled', false);
                });
            }
        }

        //Demo
        layui.use('form', function () {
            var form = layui.form();
            //监听提交
            form.on('submit(formDemo)', function (data) {
                var option = {
                    dataType: 'json',
                    url: '/Handler/SyzyyHandler.ashx?Action=SearchInHospitalMoney&openid=' + '<%=openid %>',
                    beforeSubmit: function (a) {
                        var flag = true;
                        var msg = '';

                        if ($.trim($('#realName').val()) == '') {
                            flag = false;
                            msg = '请填写就诊人姓名';
                            layer.msg(msg, {
                                time: 1000 //2秒关闭（如果不配置，默认是3秒）
                            });
                            return flag;
                        }


                        if ($.trim($('#idCard').val()) == '' && $('#idCard') != '') {
                            flag = false;
                            msg = '请填写身份证号';
                            new YLT.mobile.autoMsg({ 'msg': msg });
                            return flag;
                        } else if (!isIdCardNo($('#idCard').val().toUpperCase())) {
                            flag = false;
                            msg = '身份证号格式不正确';
                            layer.msg(msg, {
                                time: 1000 //2秒关闭（如果不配置，默认是3秒）
                            });
                            return flag;
                        }


                        if ($.trim($('#patientCard').val()) == '') {
                            flag = false;
                            msg = '请填写住院号';
                            layer.msg(msg, {
                                time: 1000 //2秒关闭（如果不配置，默认是3秒）
                            });
                            return flag;
                        }
                        $("#add_jzr").text("查询中...");
                        $("#add_jzr").attr('disabled', true);
                    },
                    success: ShowRequest
                };
                $('#AddForm').ajaxForm(option);
            });
        });

    </script>

</body>
</html>
